home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat2 / standard / semctl.z / semctl
Encoding:
Text File  |  2002-10-03  |  11.7 KB  |  199 lines

  1.  
  2.  
  3.  
  4. sssseeeemmmmccccttttllll((((2222))))                                                            sssseeeemmmmccccttttllll((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _ssss_eeee_mmmm_cccc_tttt_llll - semaphore control operations
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_iiii_pppp_cccc_...._hhhh_>>>>
  14.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_ssss_eeee_mmmm_...._hhhh_>>>>
  15.  
  16.      _uuuu_nnnn_iiii_oooo_nnnn _ssss_eeee_mmmm_uuuu_nnnn _{{{{
  17.           _iiii_nnnn_tttt _vvvv_aaaa_llll_;;;;
  18.           _ssss_tttt_rrrr_uuuu_cccc_tttt _ssss_eeee_mmmm_iiii_dddd______dddd_ssss _****_bbbb_uuuu_ffff_;;;;
  19.           _uuuu_ssss_hhhh_oooo_rrrr_tttt _****_aaaa_rrrr_rrrr_aaaa_yyyy_;;;;
  20.      _}}}}_;;;;
  21.  
  22.      _iiii_nnnn_tttt _ssss_eeee_mmmm_cccc_tttt_llll_((((_iiii_nnnn_tttt _ssss_eeee_mmmm_iiii_dddd_,,,, _iiii_nnnn_tttt _ssss_eeee_mmmm_nnnn_uuuu_mmmm_,,,, _iiii_nnnn_tttt _cccc_mmmm_dddd_,,,, _...._...._.... _////_**** _uuuu_nnnn_iiii_oooo_nnnn _ssss_eeee_mmmm_uuuu_nnnn _aaaa_rrrr_gggg _****_////_))))_;;;;
  23.  
  24. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  25.      _ssss_eeee_mmmm_cccc_tttt_llll provides a variety of semaphore control operations as specified by
  26.      _c_m_d.
  27.  
  28.      The following _c_m_ds are executed with respect to the semaphore specified
  29.      by _s_e_m_i_d and _s_e_m_n_u_m:
  30.  
  31.           _GGGG_EEEE_TTTT_VVVV_AAAA_LLLL     Return the value of _ssss_eeee_mmmm_vvvv_aaaa_llll [see _iiii_nnnn_tttt_rrrr_oooo(2)].  {READ}
  32.  
  33.           _SSSS_EEEE_TTTT_VVVV_AAAA_LLLL     Set the value of _ssss_eeee_mmmm_vvvv_aaaa_llll to _a_r_g._vvvv_aaaa_llll.  {ALTER}.  When this
  34.                      command is successfully executed, the _ssss_eeee_mmmm_aaaa_dddd_jjjj value
  35.                      corresponding to the specified semaphore in all processes
  36.                      is cleared.
  37.  
  38.           _GGGG_EEEE_TTTT_PPPP_IIII_DDDD     Return the value of _((((_iiii_nnnn_tttt_)))) _ssss_eeee_mmmm_pppp_iiii_dddd.  {READ}
  39.  
  40.           _GGGG_EEEE_TTTT_NNNN_CCCC_NNNN_TTTT    Return the value of _ssss_eeee_mmmm_nnnn_cccc_nnnn_tttt.  {READ}
  41.  
  42.           _GGGG_EEEE_TTTT_ZZZZ_CCCC_NNNN_TTTT    Return the value of _ssss_eeee_mmmm_zzzz_cccc_nnnn_tttt.  {READ}
  43.  
  44.      The following _c_m_ds return and set, respectively, every _ssss_eeee_mmmm_vvvv_aaaa_llll in the set
  45.      of semaphores.
  46.  
  47.           _GGGG_EEEE_TTTT_AAAA_LLLL_LLLL     Place _ssss_eeee_mmmm_vvvv_aaaa_lllls into array pointed to by _a_r_g._aaaa_rrrr_rrrr_aaaa_yyyy.  {READ}
  48.  
  49.           _SSSS_EEEE_TTTT_AAAA_LLLL_LLLL     Set _ssss_eeee_mmmm_vvvv_aaaa_lllls according to the array pointed to by
  50.                      _a_r_g._aaaa_rrrr_rrrr_aaaa_yyyy.  {ALTER}.  When this cmd is successfully
  51.                      executed, the _ssss_eeee_mmmm_aaaa_dddd_jjjj values corresponding to each
  52.                      specified semaphore in all processes are cleared.
  53.  
  54.      The following _c_m_ds are also available:
  55.  
  56.           _IIII_PPPP_CCCC______SSSS_TTTT_AAAA_TTTT   Place the current value of each member of the data
  57.                      structure associated with _s_e_m_i_d into the structure
  58.                      pointed to by _a_r_g._bbbb_uuuu_ffff.  The contents of this structure
  59.                      are defined in _iiii_nnnn_tttt_rrrr_oooo(2).  {READ}
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. sssseeeemmmmccccttttllll((((2222))))                                                            sssseeeemmmmccccttttllll((((2222))))
  71.  
  72.  
  73.  
  74.           _IIII_PPPP_CCCC______SSSS_EEEE_TTTT    Set the value of the following members of the data
  75.                      structure associated with _s_e_m_i_d to the corresponding
  76.                      value found in the structure pointed to by _a_r_g._bbbb_uuuu_ffff:
  77.  
  78.                          _ssss_eeee_mmmm______pppp_eeee_rrrr_mmmm_...._uuuu_iiii_dddd
  79.                          _ssss_eeee_mmmm______pppp_eeee_rrrr_mmmm_...._gggg_iiii_dddd
  80.                          _ssss_eeee_mmmm______pppp_eeee_rrrr_mmmm_...._mmmm_oooo_dddd_eeee _////_**** _oooo_nnnn_llll_yyyy _aaaa_cccc_cccc_eeee_ssss_ssss _pppp_eeee_rrrr_mmmm_iiii_ssss_ssss_iiii_oooo_nnnn _bbbb_iiii_tttt_ssss _****_////
  81.  
  82.                      This command can be executed only by a process that has
  83.                      an effective user ID equal to the value of _ssss_eeee_mmmm______pppp_eeee_rrrr_mmmm_...._cccc_uuuu_iiii_dddd
  84.                      or _ssss_eeee_mmmm______pppp_eeee_rrrr_mmmm_...._uuuu_iiii_dddd in the data structure associated with
  85.                      _s_e_m_i_d or to a process that has the _ssss_uuuu_pppp_eeee_rrrr_----_uuuu_ssss_eeee_rrrr privilege.
  86.  
  87.           _IIII_PPPP_CCCC______RRRR_MMMM_IIII_DDDD   Remove the semaphore identifier specified by _s_e_m_i_d from
  88.                      the system and destroy the set of semaphores and data
  89.                      structure associated with it.  This command can be
  90.                      executed only by a process that has an effective user ID
  91.                      equal to the value of _ssss_eeee_mmmm______pppp_eeee_rrrr_mmmm_...._cccc_uuuu_iiii_dddd or _ssss_eeee_mmmm______pppp_eeee_rrrr_mmmm_...._uuuu_iiii_dddd in
  92.                      the data structure associated with _s_e_m_i_d or to a process
  93.                      that has the _ssss_uuuu_pppp_eeee_rrrr_----_uuuu_ssss_eeee_rrrr privilege.
  94.  
  95.      _ssss_eeee_mmmm_cccc_tttt_llll fails if one or more of the following are true:
  96.  
  97.      _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS         Operation permission is denied to the calling process [see
  98.                     _iiii_nnnn_tttt_rrrr_oooo(2)].
  99.  
  100.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL         _s_e_m_i_d is not a valid semaphore identifier.
  101.  
  102.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL         _s_e_m_n_u_m is less than 0 or greater than _ssss_eeee_mmmm______nnnn_ssss_eeee_mmmm_ssss.
  103.  
  104.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL         _c_m_d is not a valid command.
  105.  
  106.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL         _c_m_d is _IIII_PPPP_CCCC______SSSS_EEEE_TTTT and _ssss_eeee_mmmm______pppp_eeee_rrrr_mmmm_...._uuuu_iiii_dddd or _ssss_eeee_mmmm______pppp_eeee_rrrr_mmmm_...._gggg_iiii_dddd is not
  107.                     valid.
  108.  
  109.      _EEEE_OOOO_VVVV_EEEE_RRRR_FFFF_LLLL_OOOO_WWWW      _c_m_d is _IIII_PPPP_CCCC______SSSS_TTTT_AAAA_TTTT and _u_i_d or _g_i_d is too large to be stored
  110.                     in the structure pointed to by _a_r_g._b_u_f.
  111.  
  112.      _EEEE_RRRR_AAAA_NNNN_GGGG_EEEE         _c_m_d is _SSSS_EEEE_TTTT_VVVV_AAAA_LLLL or _SSSS_EEEE_TTTT_AAAA_LLLL_LLLL and the value to which _ssss_eeee_mmmm_vvvv_aaaa_llll is
  113.                     to be set is greater than the system imposed maximum.
  114.  
  115.      _EEEE_PPPP_EEEE_RRRR_MMMM          _c_m_d is equal to _IIII_PPPP_CCCC______RRRR_MMMM_IIII_DDDD or _IIII_PPPP_CCCC______SSSS_EEEE_TTTT and the effective user
  116.                     ID of the calling process is not equal to the value of
  117.                     _ssss_eeee_mmmm______pppp_eeee_rrrr_mmmm_...._cccc_uuuu_iiii_dddd or _ssss_eeee_mmmm______pppp_eeee_rrrr_mmmm_...._uuuu_iiii_dddd in the data structure
  118.                     associated with _s_e_m_i_d and the calling process does not
  119.                     have _ssss_uuuu_pppp_eeee_rrrr_----_uuuu_ssss_eeee_rrrr privilege.
  120.  
  121.      _EEEE_FFFF_AAAA_UUUU_LLLL_TTTT         _a_r_g_...._bbbb_uuuu_ffff points to an illegal address.
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. sssseeeemmmmccccttttllll((((2222))))                                                            sssseeeemmmmccccttttllll((((2222))))
  137.  
  138.  
  139.  
  140. SEE ALSO
  141.      _iiii_nnnn_tttt_rrrr_oooo(2), _ssss_eeee_mmmm_gggg_eeee_tttt(2), _ssss_eeee_mmmm_oooo_pppp(2).
  142.  
  143. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  144.      Upon successful completion, the value returned depends on _c_m_d as follows:
  145.           _GGGG_EEEE_TTTT_VVVV_AAAA_LLLL    the value of _ssss_eeee_mmmm_vvvv_aaaa_llll
  146.           _GGGG_EEEE_TTTT_PPPP_IIII_DDDD    the value of _((((_iiii_nnnn_tttt_)))) _ssss_eeee_mmmm_pppp_iiii_dddd
  147.           _GGGG_EEEE_TTTT_NNNN_CCCC_NNNN_TTTT   the value of _ssss_eeee_mmmm_nnnn_cccc_nnnn_tttt
  148.           _GGGG_EEEE_TTTT_ZZZZ_CCCC_NNNN_TTTT   the value of _ssss_eeee_mmmm_zzzz_cccc_nnnn_tttt
  149.           all others
  150.                     a value of 0
  151.      Otherwise, a value of -1 is returned and _eeee_rrrr_rrrr_nnnn_oooo is set to indicate the
  152.      error.
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.